package cn.springcloudandalibaba.exception;

import cn.springcloudandalibaba.vo.ResultCode;

public class ApiException extends RuntimeException {
    private  ResultCode resultCode;
    private String message;
    ApiException(String message) {
        this(ResultCode.FAILED, message);
    }

    ApiException(ResultCode resultCode) {
        this(resultCode, resultCode.getMessage());
    }

    ApiException(ResultCode resultCode, String message) {
        super(message);
        this.message = message;
        this.resultCode = resultCode;
    }
    public ResultCode getResultCode() {
        return resultCode;
    }
    @Override
    public String getMessage() {
        return message;
    }
}
